package com.java.simple.smallmybatis.session.defaults;

import com.java.simple.smallmybatis.binding.MapperRegistry;
import com.java.simple.smallmybatis.session.SqlSession;
import com.java.simple.smallmybatis.session.SqlSessionFactory;
import lombok.RequiredArgsConstructor;

/**
 * @author zhoujunlin
 * @date 2022年12月22日 15:19
 * @desc
 */
@RequiredArgsConstructor
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private final MapperRegistry mapperRegistry;

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(mapperRegistry);
    }
}
